package com.itheima.thread;

public class Demo06 {
    public static void main(String[] args) {
        MyT myT = new MyT("舒克");
       // myT.setName("飞机");
        MyT myT2 = new MyT("贝塔");
       // myT2.setName("坦克");
        myT2.setPriority(6);
        System.out.println("舒克的优先级是"+myT.getPriority());
        myT.start();
        myT2.start();

    }

}

class MyT extends Thread {
    public MyT() {
    }

    public MyT(String name) {
        super(name);
    }

    @Override
    public void run() {
        String name = this.getName();
        for (int i = 0; i < 100; i++) {
            System.out.println(name + "执行到了" + i);
        }
    }
}